package com.zxx.pattern.flyweight.fly2;

/**
 * @author zxx on 2021/7/16
 */
public class TestFly2 {
    public static void main(String[] args) {
        Shape shape1 = FlyweightFactory.getShape("red");
        shape1.draw();

        Shape shape2 = FlyweightFactory.getShape("green");
        shape2.draw();

        Shape shape3 = FlyweightFactory.getShape("red");
        shape3.draw();

        System.out.println("共绘制了 " + FlyweightFactory.getSum() + " 个颜色的圆形");
    }
}
